package com.spddr.pmos.cxf.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;

import com.spddr.pmos.cxf.JaxrsSubstation;
import com.spddr.pmos.jpa.Line;
import com.spddr.pmos.jpa.Substation;
import com.spddr.pmos.repos.LineRepos;
import com.spddr.pmos.repos.SubstationRepos;

@Service
public class JaxrsSubstationImpl extends AbstractJaxrsObjectImpl<Substation> implements JaxrsSubstation {
	@Autowired
	private SubstationRepos repository;
	@Autowired
	private LineRepos lineRepos;

	@Override
	public JpaRepository<Substation, Long> getRepository() {
		return repository;
	}

	@Override
	public List<Line> lines(long id) {
		return lineRepos.findBySubstationId(id);
	}
}
